<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2019/12/16
  Time: 18:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
     String userName="";
     String passWord="";

     Cookie []cookie=request.getCookies();   //获取cookie

    if(cookie!=null&&cookie.length>0){
        for (Cookie c:cookie){
            if(c.getName().equals("userName")){
                userName=c.getValue();
            }
            if(c.getName().equals("passWord")){
                passWord=c.getValue();
            }

        }
    }
 %>

用户名:<%=userName%><br>
密码:<%=passWord%><br>

</body>
</html>
